<template>
  <view>
    <u-tabbar
      :value="value"
      @change="change"
      :fixed="true"
      :placeholder="true"
      :safeAreaInsetBottom="false"
    >
      <u-tabbar-item
        v-for="(item, index) in list"
        :key="index"
        :text="item.text"
        :icon="item.icon"
        @click="click"
      ></u-tabbar-item>
    </u-tabbar>
  </view>
</template>

<script>
export default {
  props: {
    value: Number,
  },
  data() {
    return {
      list: [
        { text: '首页', icon: 'home', page: '/pages/index/index' },
        // {text:"设备树", icon:"list-dot", page:"/pages/equipment/index"},
        { text: '通道资源', icon: 'map', page: '/pages/way/index' },
		{ text: '在线监测', icon: 'eye', page: '/pages/monitor/index' },
      ],
    }
  },
  onLoad() {},
  methods: {
    change(index) {
      let item = this.list[index]
      uni.redirectTo({
        url: item.page,
      })
    },
    click(index) {
      let item = this.list[index]
      uni.redirectTo({
        url: item.page,
      })
    },
  },
}
</script>

<style></style>
